package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.pojo.User;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.itheima.service.LoginService;

@RestController
public class LoginTest {
//    远程注入
    @Reference
    private LoginService loginService;

    @RequestMapping("/login.do")
    public User login(@RequestParam("username") String name, @RequestParam("password") String pwd) {
        System.out.println("用户名:" + name);
        System.out.println("密码:" + pwd);
        User res = loginService.login(name, pwd);
        System.out.println("user:" + res);
        return res;
    }
}
